package View;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import Model.*;
import Controller.*;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.table.DefaultTableModel;

import com.anlugifa.editor.ui.JEditor;

public class TelaReceituario extends JPanel{
	JPanel receituario;
	private JTable table;
	private JTextField textField;
	public TelaReceituario()  {
		receituario = new JPanel();
		receituario.setBackground(null);
		receituario.setBackground(null);
		
		JLabel lblPosologia = new JLabel("POSOLOGIAS");
		lblPosologia.setBounds(10, 99, 96, 14);
		lblPosologia.setHorizontalAlignment(SwingConstants.RIGHT);
		
		JComboBox comboBox_2 = new JComboBox();
		comboBox_2.setBounds(116, 95, 176, 23);
		
		JButton btnNova = new JButton("EDITAR");
		btnNova.setBackground(new Color(255, 255, 255));
		btnNova.setForeground(new Color(0, 175, 239));
		btnNova.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnNova.setBounds(302, 95, 96, 23);
		
		JButton btnSalvar = new JButton("SALVAR");
		btnSalvar.setBounds(408, 95, 96, 23);
		btnSalvar.setBackground(new Color(255, 255, 255));
		btnSalvar.setForeground(new Color(0, 175, 239));
		
		btnSalvar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		
		JButton btnImprimir = new JButton("LIMPAR");
		btnImprimir.setBackground(new Color(255, 255, 255));
		btnImprimir.setForeground(new Color(0, 175, 239));
		
		
		
		btnImprimir.setBounds(514, 95, 96, 23);
		btnImprimir.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
			}
		});
		
		JPanel panel = new JPanel();
		panel.setBounds(10, 11, 369, 73);
		panel.setBackground(null);
		ConsultarPessoa cp = new ConsultarPessoa();
		receituario.setLayout(null);
		panel.add(cp.consultar);
		panel.setLayout(new GridLayout(1, 0, 0, 0));
		receituario.add(panel);
		receituario.add(lblPosologia);
		receituario.add(comboBox_2);
		receituario.add(btnNova);
		receituario.add(btnSalvar);
		receituario.add(btnImprimir);
		
		JPanel panel_2 = new JPanel();
		panel_2.setBackground(null);
		panel_2.setBounds(20, 124, 1076, 371);
		receituario.add(panel_2);
		panel_2.setLayout(null);
		
		JPanel panel_1 = new JPanel();
		panel_1.setBackground(null);
		panel_1.setBounds(10, 11, 1056, 37);
		panel_2.add(panel_1);
		panel_1.setBackground(null);
		
		textField = new JTextField();
		textField.setColumns(10);
		
		JLabel lblPosologia_1 = new JLabel("posologia");
		GroupLayout gl_panel_1 = new GroupLayout(panel_1);
		gl_panel_1.setHorizontalGroup(
			gl_panel_1.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_1.createSequentialGroup()
					.addGap(2)
					.addComponent(lblPosologia_1)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(textField, GroupLayout.PREFERRED_SIZE, 148, GroupLayout.PREFERRED_SIZE)
					.addContainerGap(427, Short.MAX_VALUE))
		);
		gl_panel_1.setVerticalGroup(
			gl_panel_1.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_panel_1.createSequentialGroup()
					.addContainerGap()
					.addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
						.addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblPosologia_1))
					.addContainerGap(13, Short.MAX_VALUE))
		);
		panel_1.setLayout(gl_panel_1);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 49, 626, 274);
		panel_2.add(scrollPane);
		
		//JEditor editor = JEditor.getInstance(); 
		JEditorPane editorPane = new JEditorPane();
		scrollPane.setViewportView(editorPane);
		
		JScrollPane scrollPane_1 = new JScrollPane();
		scrollPane_1.setBounds(646, 49, 420, 274);
		panel_2.add(scrollPane_1);
		scrollPane_1.getViewport().setBackground(new Color(100, 175, 239));
		
		table = new JTable();
		table.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"ID", "POSOLOGIAS", "PACIENTE", "DENTISTA"
			}
		));
		scrollPane_1.setViewportView(table);
		
		JButton btnExcluir = new JButton("EXCLUIR");
		btnExcluir.setBounds(977, 334, 89, 23);
		panel_2.add(btnExcluir);
		
				btnExcluir.setBackground(new Color(255, 255, 255));
				btnExcluir.setForeground(new Color(0, 175, 239));
				
				JButton btnEditar = new JButton("EDITAR");
				btnEditar.setBounds(878, 334, 89, 23);
				panel_2.add(btnEditar);
				btnEditar.setBackground(new Color(255, 255, 255));
				btnEditar.setForeground(new Color(0, 175, 239));
				
				btnEditar.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
					}
				});
				
				btnExcluir.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
					}
				});
	}
}
